package com.ourteam.frame.web;

import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.math.RandomUtils;

public class RGBColors {
	private static final String[] COLORS = { "#FFC0CB", "#FFDAB9", "#9400D3", "#6A5ACD", "#FFA500", "#F8F8FF",
			"#2E8B57", "#006400", "#00CED1", "#4682B4", "#FF00FF", "#FF4500", "#D3D3D3", "#B0C4DE", "#F0FFF0",
			"#AFEEEE", "#ADFF2F", "#D2691E", "#66CDAA", " #483D8B", "#008B8B", "#FFEBCD", "#556B2F", "#FFFFFF",
			"#BDB76B", "#FFEFD5", "#008080", "#FFE4E1", "#E9967A", "#FFB6C1", "#EEE8AA", "#FAF0E6", "#FFFFE0",
			"#B0E0E6", "#E6E6FA", "#DEB887", "#8B4513", "#00FFFF", "#00008B", "#F0FFFF", "#00FF7F", "#FF8C00",
			"#D8BFD8", "#4B0082", "#1E90FF", "#0000FF", "#DB7093", "#FA8072", "#FAFAD2", "#F5F5F5", "#E0FFFF",
			"#B22222", "#FFE4B5", "#800000", "#FF00FF", "#FFFFF0", "#F5F5DC", "#A52A2A", "#ADD8E6", "#DCDCDC",
			"#8B0000", "#800080", "#FFFACD", "#87CEFA", "#FFF0F5", "#DDA0DD", "#6495ED", "#FFF5EE", "#FFA07A",
			"#9ACD32", "#FF69B4", "#F4A460", "#A9A9A9", "#FFD700", "#C71585", "#2F4F4F", "#B8860B", "#D2B48C",
			"#00FF00", "#20B2AA", "#90EE90", "#F5DEB3", "#DAA520", "#008000", "#CD853F", "#DA70D6", "#9370DB",
			"#DC143C", "#000080", "#FF7F50", "#778899", "#696969", "#FFDEAD", "#808080", "#FFFF00", "#7FFF00",
			"#F0F8FF", "#0000CD", "#FFE4C4", "#32CD32", "#8B008B", "#7FFFD4", "#191970", "#40E0D0", "#87CEEB",
			"#BA55D3", "#6B8E23", "#FFFAF0", "#7B68EE", "#FFFAFA", "#CD5C5C", "#FF6347", "#9932CC", "#BC8F8F",
			"#FDF5E6", "#98FB98", "#708090", "#C0C0C0", "#F0E68C", "#F5FFFA", "#FF0000", "#00BFFF", "#F08080",
			"#EE82EE", "#4169E1", "#3CB371", "#00FA9A", "#8FBC8F", "#A0522D", "#8A2BE2", "#00FFFF", "#5F9EA0",
			"#FAEBD7", "#808000", "#FF1493", "#228B22", "#7CFC00" };

	public static String getRandomColor() {
		return COLORS[RandomUtils.nextInt(COLORS.length - 1)];
	}

	public static String[] getColors() {
		return COLORS;
	}

	public static String[] getColors(int count) {
		return (String[]) ArrayUtils.subarray(COLORS, 0, count);
	}

	public static String[] getRandomColor(int count) {
		String[] colorArray = new String[count];

		for (int i = 0; i < colorArray.length; i++) {
			colorArray[i] = getRandomColor();
		}

		return colorArray;
	}

}
